﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace command
{
    public class dirdata//此类暂时用于目录编辑
    {
        string dirname = "";
        string chinaname = "";
        int parentid = 0;
        string aproperty = "";
        string remark = "";
        int aid = 0;
        public dirdata(string strid)
        {
            DataTable da = new DataTable();
            string sql = "select * from adir where id = " + strid; //查出该ID号的所有其它资料
            SqlDataAdapter dt = new SqlDataAdapter(sql, Maticsoft.DBUtility.Class1.cn);
            dt.Fill(da);
            //如果有记录就赋值
            if (da.Rows.Count > 0)
            {
                dirname = da.Rows[0]["dirname"].ToString();
                chinaname = da.Rows[0]["chinaname"].ToString();
                parentid = Convert.ToInt32(da.Rows[0]["parentid"].ToString());//需要int值,需要转换
                aproperty = da.Rows[0]["aproperty"].ToString();
                remark = da.Rows[0]["remark"].ToString();
                aid = Convert.ToInt32(da.Rows[0]["id"].ToString());//需要int值,需要转换 id值
            }
        }
        public string Dirname
        {
            get { return dirname; }
        }
        public string Chinaname
        {
            get { return chinaname; }
        }
        public int Parentid
        {
            get { return parentid; }
        }
        public string Aproperty
        {
            get { return aproperty; }
        }
        public string Remark
        {
            get { return remark; }
        }
        public int Aid
        {
            get { return aid; }
        }
    }

}
